package com.explorex.infra.puma.gateway.netty.common.enums;

public enum LonglinkErrorEnum {
    SUCCESS(0, "success"),
    SYSTEM_ERR(-1, ""),
    WS_UN_AUTH_CLOSE_WEB_SOCKET(3100, "UnAuth close socket"),
    WS_IDLE_CLOSE_WEB_SOCKET(3101, "Idle, close socket"),
    WS_SERVER_CLOSE_WEB_SOCKET(3102, "Server close socket"),
    WS_CHANNEL_IS_NULL_CLOSE_WEB_SOCKET(3103, "Channel ctx is null close socket"),
    WS_UNEXPECT_EXCEPTION_CLOSE_WEB_SOCKET(3104, "Unexpect disconnect"),
    ERR_COMM_INVALID_NULL(1000000, "Is null"),
    ERR_COMM_INVALID_JSON(1000001, "Not a json format"),
    ERR_COMM_INVALID_PB(1000002, "Not a protobuf format"),
    ERR_COMM_INVALID_PARAMETERS(1000003, "Message format parameter invalid"),
    ERR_COMM_SERIALIZE_FAILED(1000004, "Serialize failed"),
    ERR_COMM_DESERIALIZE_FAILED(1000005, "Deserialize failed"),
    ERR_COMM_ENCODE_FAILED(1000006, "Encode failed"),
    ERR_COMM_DECODE_FAILED(1000007, "Decode failed"),
    ERR_COMM_ENCRYPT_FAILED(1000008, "Encryp failed"),
    ERR_COMM_DECRYPT_FAILED(1000009, "Decrypt failed"),
    ERR_COMM_REQ_SIZE_LIMIT(1000010, "Request body size is too big"),
    ERR_COMM_TASK_TIMEOUT(1000011, "task is timeout"),
    ERR_COMM_RPC_TIMEOUT_FAILED(1000012, "rpc request time out"),
    ERR_COMM_EXCEPTION(1000013, "Undefine exception"),
    ERR_COMM_SDK_VERSION_UNSUPPORTED(1000014, "SDK version is unsupported,current is %s, supported : %s"),
    ERR_SDK_NET_INVALID_PARAMETERS(2000000, "Parameters invalid"),
    ERR_SDK_NET_CONN_TIMEOUT(2000001, "Connect timeout"),
    ERR_SDK_NET_CONN_REFUSE(2000002, "Connect refused"),
    ERR_SDK_NET_COMPRESS_FAILED(2000003, "Data compressed failed"),
    ERR_SDK_NET_UNCOMPRESS_FAILED(2000004, "Data uncompressed failed"),
    ERR_SDK_NET_AUTH_INVALID(2000005, "Connected un authed"),
    ERR_SDK_NET_FREQ_LIMIT(2000006, "Request too fast or is limited"),
    ERR_SDK_NET_SOCKET_LIMIT(2000007, "This account login in too many"),
    ERR_SDK_NET_CLOSE_KICK_OUT(2000008, "Account is kick out "),
    ERR_SDK_NET_CLOSE_UN_AUTH(2000009, "Your connection is un auth, server close it"),
    ERR_SDK_NET_CLOSE_IDLE(2000010, "Your connection is idle for a while ,server close it"),
    ERR_SDK_NET_SEND_FAILED(2000011, "Data send failed"),
    ERR_SDK_NET_WAIT_ACK_TIMEOUT(2000012, "Data sent, wait for ack timeout"),
    ERR_SDK_NET_PROTOCOL_HEADER_INVALID(2000013, "Protocol data invalid,header is error"),
    ERR_SDK_NET_PROTOCOL_BODY_INVALID(2000014, "Protocol data invalid,body is error"),
    ERR_SDK_NET_SERVICE_ID_ERROR(2000015, "Service id is error in header message!"),
    ERR_SDK_NET_BIZ_LINK_CONFIG_GET_PARAM_ERROR(2000016, "Req biz link config get param error"),
    ERR_SVR_NO_CHANNEL_ERROR(2000017, "Down req no channel"),
    ERR_SVR_CLIENT_IN_BACK_GROUND_ERROR(2000018, "Client in black ground"),
    ERR_SVR_CHANNEL_CANNOT_WRITE_ERROR(2000019, "Client channel cannot write"),
    ERR_SVR_CHANNEL_CLOSE_ERROR(2000020, "Client channel close"),
    ERR_SDK_NET_USER_OFFLINE(2100001, "User is offline"),
    ERR_ACCOUNT_PARAM_INVALID(3000000, "Account token required params invalid"),
    ERR_ACCOUNT_TOKEN_INVALID(3000001, "login token invalid"),
    ERR_ACCOUNT_UID_NULL(3000002, "Account user id is null"),
    ERR_ACCOUNT_LOGIN_EXPIRED(3100000, "Login expired"),
    ERR_ACCOUNT_NO_AUTH(3100001, "Account has not privilege"),
    ERR_ACCOUNT_TICK_OUT(3100002, "For your safe,please do not login in on other device"),
    ERROR_VIRTUAL_LINK_FAILED(3101000, "Virtual link failed"),
    ERROR_VIRTUAL_LINK_TOKEN_INVALID(3101001, "Virtual link token invalid"),
    ERR_SVR_NET_SYSTEM_ERROR(5000000, "up req system error"),
    ERR_SVR_NET_PROCESS_POOL_FULL(5000001, "up req process pool full"),
    ERR_SVR_NET_PROCESS_BIZ_SERVICE_FAIL(5000002, "up req process biz service fail"),
    ERR_SVR_NET_PROCESS_AUTH_SYSTEM_ERROR(5000003, "up req process auth system error"),
    ERR_SVR_NET_PROCESS_VIRTUAL_LINK_SYSTEM_ERROR(5000004, "up req process virtual link system error"),
    ERR_SVR_NET_CONFIG_GET_SYSTEM_ERROR(5000005, "up req config get system error"),
    ERR_SVR_GET_LOGIN_TOKEN_ERROR(5001000, "Get client login token error"),
    ERR_SVR_REFRESH_TOKEN_ERROR(5001001, "Refresh client  token get system error"),
    ERR_SVR_ROUTER_SYSTEM_ERROR(5002000, "client router process system error"),
    ERR_SVR_ROUTER_BIZ_SERVICE_SYSTEM_ERROR(5002001, "client router process biz system error"),
    ERR_SVR_CHANNEL_WRITE_ERROR(5200000, "down req fail"),
    ERR_SVR_CHANNEL_WRITE_EXCEPTION(5200001, "down req channel write exception"),
    ERR_SVR_CHANNEL_WRITE_FAILED(5200002, "down req channel write failed"),
    ERR_SVR_ACK_TIMEOUT_ERROR(5200003, "down req ack timeout");

    private int value;
    private String desc;

    private LonglinkErrorEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}